#include <assert.h>
#include <stdlib.h>
#include "../logger/logger.h"

#define NDEBUG

#ifndef NDEBUG
#define ASSERT_OK() AssertOk()
#define my_assert(COND) \
	do {\
		if (COND) \
			LOGGER_WRITE(Logger::Priority::DEBUG, \
			    "Assertion passed at " #COND); \
		else {\
			LOGGER_WRITE(Logger::Priority::ERROR, \
			    "Assertion fail at " #COND); \
			LOGGER_STOP(); \
			assert(false); \
		} \
	} while(0)
#else
#define ASSERT_OK() {}
#define my_assert(COND) {}
#endif
